package object.library;

public class BookList {
    private Book[] books= new Book[1024];

    //当前数组中有效元素的个数
    private int size=0;

    public BookList() {
        //默认填写几本书进去，方便后续的测试
        //就可以直接按照任意顺序实现Operation,而无需先实现AddOperation
        books[0]=new Book("西游记","吴承恩",100,"古典小说");
        books[1]=new Book("红楼梦","曹雪芹",80,"古典小说");
        books[2]=new Book("高等数学","高斯",90,"数学");
        books[3]=new Book("Java 入门到精通","詹姆斯高斯林",120,"计算机");
        books[4]=new Book("西游记","吴承恩",100,"古典小说");
        size=5;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public Book getBook(int index) {
        return books[index];
    }

    public void setBook(int index, Book book) {
        books[index] = book;
    }
}
